Page({
  data: {
    menuItems: [
      { icon: '/pages/index/image/my-order.png', label: '我的订单' },
      { icon: '/pages/index/image/my-coupons.png', label: '我的卡券' },
      // { icon: '/pages/index/image/work-book.png', label: '课评/作业' },
      // { icon: '/pages/index/image/my-timetable.png', label: '我的课表' },
      // { icon: '/pages/index/image/my-points.png', label: '我的积分' },
      // { icon: '/pages/index/image/my-evaluation.png', label: '我的评价' },
      // { icon: '/pages/index/image/my-site.png', label: '已约场地' },
      // { icon: '/pages/index/image/my-reservation.png', label: '我的预约' },
      // { icon: '/pages/index/image/my-coupons.png', label: '我的卡券' }
    ],
    myname: '123',
    grade: '无',
    url: '/pages/index/image/header.png'
  },
  onMenuItemTap: function (e) {
    const index = e.currentTarget.dataset.index;
    const item = this.data.menuItems[index];
    let url = '';
    if (item.label === '我的订单') {
      url = '/pages/myorder/myorder'; // 直接指定“我的订单”跳转路径
    } else if (item.label === '我的卡券') {
      url = '/pages/mycoupon/mycoupon'; // 修正路径，确保路径正确
    }
    if (url) {
      wx.navigateTo({
        url: url
      });
    }
  }
});